from parameterized import parameterized
from Day1.myList import MyList
import unittest


class TestMySplice(unittest.TestCase):
    @parameterized.expand([([1, 2, 3, 4, 5, 6], 2, 3, [1, 2, 6]),
                           (['a', 'b', 'c', 'd'], 1, 2, ['a', 'd', 2]),
                           ([1], 0, 1, []),
                           ([1, 2, 'hello', 4, 5], 0, 5, []),
                           ([1, [2, 'hello'], 4, [5, 'world']], 0, 2, [4, [5, 'world']])])
    def testcase(self, list, index, count, expect):
        ml = MyList(list)
        actural = ml.mySplice(index, count)
        self.assertEqual(expect, actural)


if __name__ == '__main__':
    suite = unittest.TestSuite()
    testCase = unittest.TestLoader().loadTestsFromTestCase(TestMySplice)
    suite.addTest(testCase)
    r = unittest.TestResult()
    suite.run(result=r)
    print(r.__dict__)
